home *** CD-ROM | disk | FTP | other *** search
/ Enter 2006 October / Enter 10 2006.iso / Uzytki / Spiceworks Desktop 0.8.34 Beta / Spiceworks.exe / ruby / bin / rdoc.bat < prev    next >
Encoding:
DOS Batch File  |  2006-05-26  |  1.7 KB  |  77 lines

  1. @echo off
  2. if not "%~f0" == "~f0" goto WinNT
  3. ruby -Sx "%0" %1 %2 %3 %4 %5 %6 %7 %8 %9
  4. goto endofruby
  5. :WinNT
  6. "%~d0%~p0ruby" -x "%~f0" %*
  7. goto endofruby
  8. #!/bin/ruby
  9. #
  10. #  RDoc: Documentation tool for source code
  11. #        (see lib/rdoc/rdoc.rb for more information)
  12. #
  13. #  Copyright (c) 2003 Dave Thomas
  14. #  Released under the same terms as Ruby
  15. #
  16. #  $Revision: 1.1 $
  17.  
  18. ## Transitional Hack ####
  19. #
  20. #  RDoc was initially distributed independently, and installed
  21. #  itself into <prefix>/lib/ruby/site_ruby/<ver>/rdoc...
  22. #
  23. #  Now that RDoc is part of the distribution, it's installed into
  24. #  <prefix>/lib/ruby/<ver>, which unfortunately appears later in the
  25. #  search path. This means that if you have previously installed RDoc,
  26. #  and then install from ruby-lang, you'll pick up the old one by
  27. #  default. This hack checks for the condition, and readjusts the
  28. #  search path if necessary.
  29.  
  30. def adjust_for_existing_rdoc(path)
  31.   
  32.   $stderr.puts %{
  33.   It seems as if you have a previously-installed RDoc in
  34.   the directory #{path}.
  35.  
  36.   Because this is now out-of-date, you might want to consider
  37.   removing the directories:
  38.  
  39.     #{File.join(path, "rdoc")}
  40.  
  41.   and
  42.  
  43.     #{File.join(path, "markup")}
  44.  
  45.   }
  46.  
  47.   # Move all the site_ruby directories to the end
  48.   p $:
  49.   $:.replace($:.partition {|path| /site_ruby/ !~ path}.flatten)
  50.   p $:
  51. end
  52.  
  53. $:.each do |path|
  54.   if /site_ruby/ =~ path 
  55.     rdoc_path = File.join(path, 'rdoc', 'rdoc.rb')
  56.     if File.exists?(rdoc_path)
  57.       adjust_for_existing_rdoc(path)
  58.       break
  59.     end
  60.   end
  61. end
  62.  
  63. ## End of Transitional Hack ##
  64.  
  65.  
  66. require 'rdoc/rdoc'
  67.  
  68. begin
  69.   r = RDoc::RDoc.new
  70.   r.document(ARGV)
  71. rescue RDoc::RDocError => e
  72.   $stderr.puts e.message
  73.   exit(1)
  74. end
  75. __END__
  76. :endofruby
  77.